<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        li{
            list-style: none;
        }
        #box{
            width:300px;
            height: 300px;
            margin: 100px auto;
            box-shadow: 0 0 8px #000;
            position: relative;
        }
        #box ul{
            width:300px;
            height: 300px;
            border-radius: 50%;
            box-shadow: 0 0 5px #000;

        }
        #box ul li{
            position: absolute;
            top:0;
            left:50%;
            width:1px;
            height: 5px;
            background: blue;
            transform-origin: center 150px;
        }
/*        #box ul li:nth-child(1){ transform: rotate(0deg) }
        #box ul li:nth-child(2){ transform: rotate(6deg) }
        #box ul li:nth-child(3){ transform: rotate(12deg) }
        #box ul li:nth-child(4){ transform: rotate(18deg) }
        #box ul li:nth-child(5){ transform: rotate(24deg) }
        #box ul li:nth-child(6){ transform: rotate(30deg) }
        #box ul li:nth-child(7){ transform: rotate(36deg) }
*/

        #rot{
            position: absolute;
            left:145px;
            top:145px;
            width:10px;
            height: 10px;
            background: blue;
            border-radius: 50%;
        }
        #rot div{
            position: absolute;
            bottom:4px;

            border-radius: 50%;
            transform-origin: bottom;
        }
        #hour{
            width:4px;
            left:50%;
            margin-left: -2px;
            height: 80px;
            background: black;
            /*transform: rotate(90deg);*/
        }
        #min{
            width: 2px;
            left:50%;
            margin-left: -1px;
            height: 100px;
            background: purple;
        }
        #sec{
            width: 1px;
            left:50%;

            height: 120px;
            background: blue;
        }
    </style>
</head>
<body>
    <div id="box">
        <ul id="ul"></ul>
        <div id="rot">
            <div id="hour"></div>
            <div id="min"></div>
            <div id="sec"></div>
        </div>
    </div>

    <script>
        creatLi();
        getTime();
        setInterval(getTime,1000);
        function creatLi(){
            for( var i=0;i<60;i++ ){
                var oLi = document.createElement('li');
                oLi['style']['transform'] = 'rotate('+i*6+'deg)';
                ul.appendChild(oLi);
            }
            var aLi = ul.getElementsByTagName('li');
            for( var i=0;i<12;i++ ){
                aLi[i*5].style.background = 'black';
                aLi[i*5].style.height = '10px';
            }
        }
        
        function getTime() {
            var oDate = new Date();
            var s = oDate.getSeconds();
            var m = oDate.getMinutes() + (s/60);
            var h = oDate.getHours() + (m/60);

            hour['style']['transform'] = 'rotate('+h*30+'deg)';
            min['style']['transform'] = 'rotate('+m*6+'deg)';
            sec['style']['transform'] = 'rotate('+s*6+'deg)';
        }
    </script>
</body>
</html>




























